package File;

import java.io.File;

public class ListFilesDemo {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            System.out.println(dir.getName()+"是文件名");
        }

        File[] subs = dir.listFiles();
        System.out.println(subs.length+"个子项");

        for(File sub : subs){
            System.out.println(sub.getName());
        }
    }

}
